#ifndef __PALYER_PET_H__
#define __PALYER_PET_H__

class PacketDecoder;
class PlayerSkill;
class PlayerPet:public PlayerSkill
{
public:
	PlayerPet(PlayerId stPlayerId);
	virtual ~PlayerPet();

	UInt32			m_nTimerSendPets;
	virtual void PrepareSendPets(){if(m_nTimerSendPets == 0) m_nTimerSendPets = CreateTimer(boost::bind(&PlayerPet::OnTimerSendPets, this,_1),1000);}
	void OnTimerSendPets(UInt32 nTimerId);

	void addPet(Int32 csv_id);
	bool hasPet(Int32 csv_id);
	Pet* getPetByIndex(Int32 nIndex);
	Pet* getPetByInnerId(Int32 nInnerId);
	static PetInfo* getPetInfoByInnerId(CharInfo& stCharInfo,Int32 nInnerId);
	Int32 getIndexByPetId(PetId id);
	void removePetByPetId(PetId id);
	void decodePets();
	void encodePets();
	void sendPets();
	
	UInt32 getPetJoinBattleIndex(){return m_stCharInfo.m_nPetJoinBattleIndex;};
	void setPetJoinBattleIndex(Int32 nIndex){m_stCharInfo.m_nPetJoinBattleIndex = nIndex;};
	Pet* getPetJoinBattle(){return getPetByIndex(m_stCharInfo.m_nPetJoinBattleIndex);};
	Int32 generatePetInnerId();
protected:
	std::vector<PetId>	m_arPets;
};
#pragma pack()
#endif